/**
 * @param {number[]} nums
 * @return {number}
 */

var missingNumber = function (nums) {
    let len = nums.length
    for (let i = 0; i < len; i++) {
        if (nums[i] !== i) {
            return i
        }
    }
    return len
};